class WarningContext {
    positionFunc = undefined
    dataFunc = undefined
    selectedFunc = undefined
  
    setPositionFunc(positionFunc) {
      this.positionFunc = positionFunc
    }
  
    setSelectedFunc(selectedFunc) {
      this.selectedFunc = selectedFunc
    }
  
    setDataFunc(dataFunc) {
      this.dataFunc = dataFunc
    }
  
    setPosition(position) {
      this.positionFunc && this.positionFunc(position)
    }
  
    setData(data) {
      this.dataFunc && this.dataFunc(data)
    }
  
    setSelected(data) {
      this.selectedFunc && this.selectedFunc(data)
    }
  }
  
  let warningContext
  export const getWarningContext = () => {
    if (!warningContext) {
      warningContext = new WarningContext()
    }
    return warningContext
  }
  